package com.awangyh.jdk8.lambda;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.Comparator;
import java.util.List;

/**
 * Created by admin on 2017/3/22.
 */
public class IntegerCompareDemo {

    public static void main(String[] args) {

        Integer[] list = new Integer[13];
        int j = 0;
        for ( int i =97 ; i < 110; i++) {
            list[j++]= i + i%5;
        }


        for ( int i = 0; i < list.length; i++) {
            System.out.println(list[i]);
        }

        System.out.println("=========================");
        //Comparator<Integer> comp = (f, s) -> Integer.compare(f, s);
        Comparator<Integer> comp = (f, s) -> f.compareTo(s);
        //Arrays.sort(list, comp);
        Arrays.sort(list, Integer::compareTo);

        for ( int i = 0; i < list.length; i++) {
            System.out.println(list[i]);
        }


    }
}
